import request from "@/utils/request.js";

const {
  get: $get,
  post: $post,
  delete: $delete,
  download: $download,
  post_query: $post_query,
} = request;

// 个人待办列表
export const taskList = (data) => {
  return $get("/activiti/activiti/task/taskList", data);
};

// 个人已办列表
export const taskDoneList = (data) => {
  return $get("/activiti/activiti/task/taskDoneList", data);
};

// 所有待办列表
export const taskAllList = (data) => {
  return $get("/activiti/activiti/task/taskAllList", data);
};

/** 获取当前任务详情
 * @returns { Promise< import("axios").AxiosResponse< import("@/types/TaskInfoVO").TaskInfoVO, import("@/types/TaskInfoVO").TaskInfoVO > > }
 */
export const getTaskInfo = async (taskId = "") =>
  request.get(`/activiti/activiti/task/getTaskInfo`, { taskId });

/** 通过业务主键查询出对应的节点办理人
 * @returns { Promise< import("axios").AxiosResponse<
 *  import("@/types/TaskActorVO").TaskActorVO[],
 *  import("@/types/TaskActorVO").TaskActorVO[],
 * > > }
 */
export const nodeCurrentUser = async (businessKey = "") =>
  request.get(`/activiti/activiti/task/nodeCurrentUser`, { businessKey });

// /** 获取当前任务详情 */
// export const getTaskInfo = (taskId = "") =>
//   request.get("/activiti/activiti/task/getTaskInfo", taskId);
